package com.losdun.points.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.losdun.points.controller.req.UserPointsReq;
import com.losdun.points.domain.UserPoints;

import java.util.List;

/**
 * @Description
 * @Author Sword.Ye
 * @Date 2025/8/18
 **/
public interface UserPointsService extends IService<UserPoints> {
    /**
     * 校验积分是否够
     * @param wxUserId
     * @param totalPoints
     * @return
     */
    boolean checkPoints(Long wxUserId, Integer totalPoints);

    void updateAvaliablePoints(Long id, int nextPoint);

    void createAccount(Long wxUserId);

    /**
     * 添加积分
     * @param wxUserId
     * @param points
     * @param type
     */
    void addPoints(Long wxUserId,int points,int type);

    /**
     * 查询用户积分列表
     * @param req
     * @return
     */
    List<UserPoints> queryUserPointsList(UserPointsReq req);
}
